/**
 * Created by Vasil Toshev on 12.01.14.
 */
/* global myTimer, $, findByText, calculateLinks, redraw*/
'use strict';
// Other code:
$("#UIForm").submit(function(e) {
    e.preventDefault();
    var tempSearchText = $( "#searchInputField").val();
    if(tempSearchText!==""){
        findByText(tempSearchText);
    }
    $("#searchInputField").val('');
});
$('#relevanceSlider').change( function() {
    calculateLinks();
});
$('#clusterCheckbox').change( function() {
    redraw();
});
$('#collisionCheckbox').change( function() {
    redraw();
});
$('#screensaverCheckbox').change( function() {
    if(myTimer.Enable){
        myTimer.Stop();
    } else {
        myTimer.Start();
    }
});
$("#removeAllButton").click( function()
    {
        window.location.reload(true);
    }
);
//override the default magnificPopup youtube parser
$.extend(true, $.magnificPopup.defaults, {
    iframe: {
        patterns: {
            youtube: {
                index: 'youtube.com/',
                id: 'embed/',
                src: '//www.youtube.com/embed/%id%?autoplay=1?modestbranding=1&;rel=0;'//&;showinfo=0&;autohide=1
            }
        }
    }
});
